FMI Ticket System
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 1 | Project Topic 4 |
Public Member Functions | List of all members
Command Class Reference

Stores a 256 character name and a function pointer to be executed when calling run() More...

#include <Command.h>

Public Member Functions

 Command ()
 Leaves name empty and exec function pointer to nullptr.
 
 Command (const char *nameInMenu, void(*exec)())
 Copies contents of nameInMenu and stores exec. More...
 
void run () const
 Executes the stored function pointer. More...
 
const char * get_nameInMenu () const
 

Detailed Description

Stores a 256 character name and a function pointer to be executed when calling run()

Menu uses this class for a more generic implementation of it's navigate function.

Constructor & Destructor Documentation

◆ Command()

Command::Command ( const char *  nameInMenu,
void(*)()  exec 
)

Copies contents of nameInMenu and stores exec.

Parameters
nameInMenuC-style string, class stores at most 255 characters (last character is always terminating zero)
execFunction pointer that will be executed when run() is called. Can be nullptr.

Member Function Documentation

◆ run()

void Command::run ( ) const

Executes the stored function pointer.

Executes the stored function pointer, when it's not nullptr. Otherwise does nothing.


The documentation for this class was generated from the following files: